package com.kefu.call.controller;

import com.kefu.common.mybatis.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kefu.common.annotation.Permission;
import com.kefu.common.controller.AbstractBaseController;
import com.kefu.common.result.Result;
import com.kefu.common.result.ResultGenerator;
import com.kefu.common.vo.DeleteVo;
import com.kefu.common.vo.DetailVo;
import com.kefu.call.model.CdrSmhistory;
import com.kefu.call.service.CdrSmhistoryService;
import com.kefu.call.vo.CdrSmhistorySearchVo;
import com.kefu.call.vo.CdrSmhistoryInsertVo;
import com.kefu.call.vo.CdrSmhistoryUpdateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "计费_套餐扣除历史记录")
@RestController
@RequestMapping("call/cdr_smhistory")
public class CdrSmhistoryController extends AbstractBaseController {

    @Autowired
    private CdrSmhistoryService cdrSmhistoryService;


    @PostMapping("/list")
    @ApiOperation(value = "查询计费_套餐扣除历史记录", notes = "查询计费_套餐扣除历史记录")
    public Result<Page<CdrSmhistory>> list(@Validated @RequestBody CdrSmhistorySearchVo search) {

        search.setOrderField("oid");
        search.setOrder(Order.DESC);
        Page<CdrSmhistory> page = cdrSmhistoryService.searchLambdaPage(search);
        return ResultGenerator.genSuccessResult(page);
    }
}
